From: Keir Fraser Date: Thu, 12 Mar 2009 15:37:12 +0000 (+0000) Subject: Add debug code to catch count_info errors in page_alloc.c X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13992^2~82 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=0ef0dcc006677405c2f83ddc54bfc9c7af8e9604;p=xen.git Add debug code to catch count_info errors in page_alloc.c This patch is temporary. Signed-off-by: Keir Fraser --- diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index eb07404e7a..fbc75cbdde 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -403,6 +403,9 @@ static struct page_info *alloc_heap_pages( for ( i = 0; i < (1 << order); i++ ) { /* Reference count must continuously be zero for free pages. */ + if ( pg[i].count_info != 0 ) + printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__, + i, 1 << order, pg[i].count_info); BUG_ON(pg[i].count_info != 0); if ( pg[i].u.free.need_tlbflush ) @@ -527,7 +530,10 @@ static void free_heap_pages( * in its pseudophysical address space). * In all the above cases there can be no guest mappings of this page. */ - ASSERT(!(pg[i].count_info & PGC_offlined)); + if ( pg[i].count_info & PGC_offlined ) + printk("** %s:%d -- %u/%u %lx\n", __FILE__, __LINE__, + i, 1 << order, pg[i].count_info); + BUG_ON(pg[i].count_info & PGC_offlined); pg[i].count_info &= PGC_offlining | PGC_broken; if ( pg[i].count_info & PGC_offlining ) { diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 898cdc1e58..0a4726e8ef 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -238,6 +238,8 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) uint32_t *status, *ptr; unsigned long pfn; + BUG(); + ptr = status = xmalloc_bytes( sizeof(uint32_t) * (op->u.page_offline.end - op->u.page_offline.start + 1));